-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[V2] Implement dev server serveStaticFile #580
Conversation
@@ -40,7 +40,7 @@ const {handler} = runtime.createHandler(options, (app) => { | |||
res.send() | |||
}) | |||
|
|||
app.get('/robots.txt', runtime.serveStaticFile('static/robots.txt')) | |||
app.get('/favicon.ico', runtime.serveStaticFile('static/favicon.ico')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The remote server already has code to handle the favicon
. So technically there are 2 handlers being setup for the when running remote, once here on line 43 of ssr.js and the second time inside the build-remote-server.js
file below:
_setupCommonMiddleware(app, options) { |
We should probably do something about that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also.. why are we removing the serving of the robots.txt
file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another reason why it might not make sense to have this line of code in ssr.js is because faviconPath
is an option for the dev/remote servers. It would be odd to have that option but not do anything with it behind the scenes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question... sorry i didn't explain that in my PR description.
Serving favicon is exactly the same as serving any static files. Since we are adding programmatic APIs like serveStaticFile
and serveServiceWorker
, I feel like it's better to keep things consistent, . If developers can already serve all static files including favicon via serveStaticFile
, why do we need to have a specific configuration option faviconPath
? It almost feels like the faviconPath
adds unnecessary complexity to the users. And it feels wrong to have two approaches (configuration and programatic API) to basically do the same thing.
So, I want to propose that we remove faviconPath
, and since @shethj is already working on the favicon ticket. I can work with @shethj to remove the option in his PR. I use favicon as an example in this PR, because that's the only static file in the template.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also.. why are we removing the serving of the robots.txt file?
There is no robots.txt in the typescript template, so that endpoint is a 404, and I feel it's unnecessary for a "minimal" template to have robots.txt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it makes sense to have robots and favicon work the same way. So that is cool with me. You'd just have to make sure you remove all that special logic in the remote server factory.
But one thing that I'm curious about is your implementation of the serveStaticFile
for the dev server factory. It's completely different from the implementation in the remote server factory and I wasn't expecting that, since I assumed that the only real issue was the fact that the build dir was set to build
for remote and it should be something like `` for development. Lets have a small chat, later and se can talk about that a bit.
* Bump V2 to `2.0.0-dev.8` (#575) * Bump version * Fix up readme for new package * Fixed loading correct amount of skeletons (#576) Port PR 525 into V2 * Make sure that generated project has pwa-kit-* packages pinned (#577) * Add comment explaining dev server import. (#578) * Add comment explaining dev server import. * lint:fix * [V2][Generator] Add `typescript-minimal` and `typescript-minimal-test-project` presets (#574) * Add `typescript-minimal` and `typescript-minimal-test-project` presets * lint * copy * Testing CI parallelism * Testing CI parameters * PR Feedback * ops forgot to update two references * Move pwa-kit-runtime to as a dependency instead of devDependency (#572) * move pwa-kit-runtime to as a dependency instead of devDependency in pwa-kit-dev * Wjh/translations docs (#570) * Update translation readme Co-authored-by: Alex Vuong <alex.vuong@salesforce.com> Co-authored-by: Vincent Marta <vmarta@salesforce.com> * [V2] Implement dev server serveStaticFile (#580) * implement dev serveStaticFile * serve favicon in typescript template * add test * move mock closer to test case * [V2] Remove dadJoke in `template-typescript-minimal` (#585) * Replaced dadjoke with simple exp to demo getProps * Added a comment to explain mock function for getProps * Reduce getProps timeout to 50ms * remove unused manifest path (#582) * Silent output when cleaning config folder (#588) * [V2]Drop node 12 support for (#589) * drop node 12 in v2 * [V2] workaround shims issue windows (#584) * fix shims issue on Windows with a workaround * [V2] Clarify that service worker does not have to be hosted at the root (#590) * [V2] Add favicon for `template-retail-react-app` (#568) * Fix favicon path in ssr.js * Conditionally update favicon url to support dev & prod builds * Remove old serve favIcon flow and favIconPath option from config * Fix lint errors * Removed test for old serve favicon flow * remove references to faviconPath * Removed references to manifestPath * Bump v2 to v2.0.0-alpha.0 (#592) * Version 2.0.0-alpha.0 * Bump to 2.0.0-alpha.0 * Bump `pwa-kit-runtime` peerDependencies to 2.0.0-alpha.0 Co-authored-by: Adam Raya Navarro <arayanavarro@salesforce.com> Co-authored-by: Ben Chypak <bchypak@mobify.com> Co-authored-by: vcua-mobify <47404250+vcua-mobify@users.noreply.github.com> Co-authored-by: Vincent Marta <vmarta@salesforce.com> Co-authored-by: Will Harney <62956339+wjhsf@users.noreply.github.com> Co-authored-by: Alex Vuong <52219283+alexvuong@users.noreply.github.com> Co-authored-by: Kevin He <kevin.he@salesforce.com> Co-authored-by: Jainam Sheth <99490559+shethj@users.noreply.github.com>
* Release V2.0.0-alpha.0 (#593) * Bump V2 to `2.0.0-dev.8` (#575) * Bump version * Fix up readme for new package * Fixed loading correct amount of skeletons (#576) Port PR 525 into V2 * Make sure that generated project has pwa-kit-* packages pinned (#577) * Add comment explaining dev server import. (#578) * Add comment explaining dev server import. * lint:fix * [V2][Generator] Add `typescript-minimal` and `typescript-minimal-test-project` presets (#574) * Add `typescript-minimal` and `typescript-minimal-test-project` presets * lint * copy * Testing CI parallelism * Testing CI parameters * PR Feedback * ops forgot to update two references * Move pwa-kit-runtime to as a dependency instead of devDependency (#572) * move pwa-kit-runtime to as a dependency instead of devDependency in pwa-kit-dev * Wjh/translations docs (#570) * Update translation readme Co-authored-by: Alex Vuong <alex.vuong@salesforce.com> Co-authored-by: Vincent Marta <vmarta@salesforce.com> * [V2] Implement dev server serveStaticFile (#580) * implement dev serveStaticFile * serve favicon in typescript template * add test * move mock closer to test case * [V2] Remove dadJoke in `template-typescript-minimal` (#585) * Replaced dadjoke with simple exp to demo getProps * Added a comment to explain mock function for getProps * Reduce getProps timeout to 50ms * remove unused manifest path (#582) * Silent output when cleaning config folder (#588) * [V2]Drop node 12 support for (#589) * drop node 12 in v2 * [V2] workaround shims issue windows (#584) * fix shims issue on Windows with a workaround * [V2] Clarify that service worker does not have to be hosted at the root (#590) * [V2] Add favicon for `template-retail-react-app` (#568) * Fix favicon path in ssr.js * Conditionally update favicon url to support dev & prod builds * Remove old serve favIcon flow and favIconPath option from config * Fix lint errors * Removed test for old serve favicon flow * remove references to faviconPath * Removed references to manifestPath * Bump v2 to v2.0.0-alpha.0 (#592) * Version 2.0.0-alpha.0 * Bump to 2.0.0-alpha.0 * Bump `pwa-kit-runtime` peerDependencies to 2.0.0-alpha.0 Co-authored-by: Adam Raya Navarro <arayanavarro@salesforce.com> Co-authored-by: Ben Chypak <bchypak@mobify.com> Co-authored-by: vcua-mobify <47404250+vcua-mobify@users.noreply.github.com> Co-authored-by: Vincent Marta <vmarta@salesforce.com> Co-authored-by: Will Harney <62956339+wjhsf@users.noreply.github.com> Co-authored-by: Alex Vuong <52219283+alexvuong@users.noreply.github.com> Co-authored-by: Kevin He <kevin.he@salesforce.com> Co-authored-by: Jainam Sheth <99490559+shethj@users.noreply.github.com> * Bump version to `2.0.0-alpha.1` * Manually bump version on `pwa-kit-runtime` peerDependency Co-authored-by: Ben Chypak <bchypak@mobify.com> Co-authored-by: vcua-mobify <47404250+vcua-mobify@users.noreply.github.com> Co-authored-by: Vincent Marta <vmarta@salesforce.com> Co-authored-by: Will Harney <62956339+wjhsf@users.noreply.github.com> Co-authored-by: Alex Vuong <52219283+alexvuong@users.noreply.github.com> Co-authored-by: Kevin He <kevin.he@salesforce.com> Co-authored-by: Jainam Sheth <99490559+shethj@users.noreply.github.com>
* Bump V2 to `2.0.0-dev.8` (#575) * Bump version * Fix up readme for new package * Fixed loading correct amount of skeletons (#576) Port PR 525 into V2 * Make sure that generated project has pwa-kit-* packages pinned (#577) * Add comment explaining dev server import. (#578) * Add comment explaining dev server import. * lint:fix * [V2][Generator] Add `typescript-minimal` and `typescript-minimal-test-project` presets (#574) * Add `typescript-minimal` and `typescript-minimal-test-project` presets * lint * copy * Testing CI parallelism * Testing CI parameters * PR Feedback * ops forgot to update two references * Move pwa-kit-runtime to as a dependency instead of devDependency (#572) * move pwa-kit-runtime to as a dependency instead of devDependency in pwa-kit-dev * Wjh/translations docs (#570) * Update translation readme Co-authored-by: Alex Vuong <alex.vuong@salesforce.com> Co-authored-by: Vincent Marta <vmarta@salesforce.com> * [V2] Implement dev server serveStaticFile (#580) * implement dev serveStaticFile * serve favicon in typescript template * add test * move mock closer to test case * [V2] Remove dadJoke in `template-typescript-minimal` (#585) * Replaced dadjoke with simple exp to demo getProps * Added a comment to explain mock function for getProps * Reduce getProps timeout to 50ms * remove unused manifest path (#582) * Silent output when cleaning config folder (#588) * [V2]Drop node 12 support for (#589) * drop node 12 in v2 * [V2] workaround shims issue windows (#584) * fix shims issue on Windows with a workaround * [V2] Clarify that service worker does not have to be hosted at the root (#590) * [V2] Add favicon for `template-retail-react-app` (#568) * Fix favicon path in ssr.js * Conditionally update favicon url to support dev & prod builds * Remove old serve favIcon flow and favIconPath option from config * Fix lint errors * Removed test for old serve favicon flow * remove references to faviconPath * Removed references to manifestPath * Bump v2 to v2.0.0-alpha.0 (#592) * Version 2.0.0-alpha.0 * Bump to 2.0.0-alpha.0 * Bump `pwa-kit-runtime` peerDependencies to 2.0.0-alpha.0 Co-authored-by: Adam Raya Navarro <arayanavarro@salesforce.com> * Merge branch `release-2.0.x` into `v2` and bump version (#595) * Release V2.0.0-alpha.0 (#593) * Bump V2 to `2.0.0-dev.8` (#575) * Bump version * Fix up readme for new package * Fixed loading correct amount of skeletons (#576) Port PR 525 into V2 * Make sure that generated project has pwa-kit-* packages pinned (#577) * Add comment explaining dev server import. (#578) * Add comment explaining dev server import. * lint:fix * [V2][Generator] Add `typescript-minimal` and `typescript-minimal-test-project` presets (#574) * Add `typescript-minimal` and `typescript-minimal-test-project` presets * lint * copy * Testing CI parallelism * Testing CI parameters * PR Feedback * ops forgot to update two references * Move pwa-kit-runtime to as a dependency instead of devDependency (#572) * move pwa-kit-runtime to as a dependency instead of devDependency in pwa-kit-dev * Wjh/translations docs (#570) * Update translation readme Co-authored-by: Alex Vuong <alex.vuong@salesforce.com> Co-authored-by: Vincent Marta <vmarta@salesforce.com> * [V2] Implement dev server serveStaticFile (#580) * implement dev serveStaticFile * serve favicon in typescript template * add test * move mock closer to test case * [V2] Remove dadJoke in `template-typescript-minimal` (#585) * Replaced dadjoke with simple exp to demo getProps * Added a comment to explain mock function for getProps * Reduce getProps timeout to 50ms * remove unused manifest path (#582) * Silent output when cleaning config folder (#588) * [V2]Drop node 12 support for (#589) * drop node 12 in v2 * [V2] workaround shims issue windows (#584) * fix shims issue on Windows with a workaround * [V2] Clarify that service worker does not have to be hosted at the root (#590) * [V2] Add favicon for `template-retail-react-app` (#568) * Fix favicon path in ssr.js * Conditionally update favicon url to support dev & prod builds * Remove old serve favIcon flow and favIconPath option from config * Fix lint errors * Removed test for old serve favicon flow * remove references to faviconPath * Removed references to manifestPath * Bump v2 to v2.0.0-alpha.0 (#592) * Version 2.0.0-alpha.0 * Bump to 2.0.0-alpha.0 * Bump `pwa-kit-runtime` peerDependencies to 2.0.0-alpha.0 Co-authored-by: Adam Raya Navarro <arayanavarro@salesforce.com> Co-authored-by: Ben Chypak <bchypak@mobify.com> Co-authored-by: vcua-mobify <47404250+vcua-mobify@users.noreply.github.com> Co-authored-by: Vincent Marta <vmarta@salesforce.com> Co-authored-by: Will Harney <62956339+wjhsf@users.noreply.github.com> Co-authored-by: Alex Vuong <52219283+alexvuong@users.noreply.github.com> Co-authored-by: Kevin He <kevin.he@salesforce.com> Co-authored-by: Jainam Sheth <99490559+shethj@users.noreply.github.com> * Bump version to `2.0.0-alpha.1` * Manually bump version on `pwa-kit-runtime` peerDependency Co-authored-by: Ben Chypak <bchypak@mobify.com> Co-authored-by: vcua-mobify <47404250+vcua-mobify@users.noreply.github.com> Co-authored-by: Vincent Marta <vmarta@salesforce.com> Co-authored-by: Will Harney <62956339+wjhsf@users.noreply.github.com> Co-authored-by: Alex Vuong <52219283+alexvuong@users.noreply.github.com> Co-authored-by: Kevin He <kevin.he@salesforce.com> Co-authored-by: Jainam Sheth <99490559+shethj@users.noreply.github.com> * comment out the session bridge call (#597) * [v2] Automatically bind all factory methods (#598) * automatically bind all factory methods * bind remote server methods * bind object functions in getRuntime * add test for getRuntime * fix lint * Update CHANGELOG files (#608) * Update CHANGELOG files * Add more changes Co-authored-by: Ben Chypak <bchypak@mobify.com> Co-authored-by: vcua-mobify <47404250+vcua-mobify@users.noreply.github.com> Co-authored-by: Vincent Marta <vmarta@salesforce.com> Co-authored-by: Will Harney <62956339+wjhsf@users.noreply.github.com> Co-authored-by: Alex Vuong <52219283+alexvuong@users.noreply.github.com> Co-authored-by: Kevin He <kevin.he@salesforce.com> Co-authored-by: Jainam Sheth <99490559+shethj@users.noreply.github.com>
* Release V2.0.0-alpha.0 (#593) * Bump V2 to `2.0.0-dev.8` (#575) * Bump version * Fix up readme for new package * Fixed loading correct amount of skeletons (#576) Port PR 525 into V2 * Make sure that generated project has pwa-kit-* packages pinned (#577) * Add comment explaining dev server import. (#578) * Add comment explaining dev server import. * lint:fix * [V2][Generator] Add `typescript-minimal` and `typescript-minimal-test-project` presets (#574) * Add `typescript-minimal` and `typescript-minimal-test-project` presets * lint * copy * Testing CI parallelism * Testing CI parameters * PR Feedback * ops forgot to update two references * Move pwa-kit-runtime to as a dependency instead of devDependency (#572) * move pwa-kit-runtime to as a dependency instead of devDependency in pwa-kit-dev * Wjh/translations docs (#570) * Update translation readme Co-authored-by: Alex Vuong <alex.vuong@salesforce.com> Co-authored-by: Vincent Marta <vmarta@salesforce.com> * [V2] Implement dev server serveStaticFile (#580) * implement dev serveStaticFile * serve favicon in typescript template * add test * move mock closer to test case * [V2] Remove dadJoke in `template-typescript-minimal` (#585) * Replaced dadjoke with simple exp to demo getProps * Added a comment to explain mock function for getProps * Reduce getProps timeout to 50ms * remove unused manifest path (#582) * Silent output when cleaning config folder (#588) * [V2]Drop node 12 support for (#589) * drop node 12 in v2 * [V2] workaround shims issue windows (#584) * fix shims issue on Windows with a workaround * [V2] Clarify that service worker does not have to be hosted at the root (#590) * [V2] Add favicon for `template-retail-react-app` (#568) * Fix favicon path in ssr.js * Conditionally update favicon url to support dev & prod builds * Remove old serve favIcon flow and favIconPath option from config * Fix lint errors * Removed test for old serve favicon flow * remove references to faviconPath * Removed references to manifestPath * Bump v2 to v2.0.0-alpha.0 (#592) * Version 2.0.0-alpha.0 * Bump to 2.0.0-alpha.0 * Bump `pwa-kit-runtime` peerDependencies to 2.0.0-alpha.0 Co-authored-by: Adam Raya Navarro <arayanavarro@salesforce.com> Co-authored-by: Ben Chypak <bchypak@mobify.com> Co-authored-by: vcua-mobify <47404250+vcua-mobify@users.noreply.github.com> Co-authored-by: Vincent Marta <vmarta@salesforce.com> Co-authored-by: Will Harney <62956339+wjhsf@users.noreply.github.com> Co-authored-by: Alex Vuong <52219283+alexvuong@users.noreply.github.com> Co-authored-by: Kevin He <kevin.he@salesforce.com> Co-authored-by: Jainam Sheth <99490559+shethj@users.noreply.github.com> * Release 2.0.0-alpha.1 version (#610) * Bump V2 to `2.0.0-dev.8` (#575) * Bump version * Fix up readme for new package * Fixed loading correct amount of skeletons (#576) Port PR 525 into V2 * Make sure that generated project has pwa-kit-* packages pinned (#577) * Add comment explaining dev server import. (#578) * Add comment explaining dev server import. * lint:fix * [V2][Generator] Add `typescript-minimal` and `typescript-minimal-test-project` presets (#574) * Add `typescript-minimal` and `typescript-minimal-test-project` presets * lint * copy * Testing CI parallelism * Testing CI parameters * PR Feedback * ops forgot to update two references * Move pwa-kit-runtime to as a dependency instead of devDependency (#572) * move pwa-kit-runtime to as a dependency instead of devDependency in pwa-kit-dev * Wjh/translations docs (#570) * Update translation readme Co-authored-by: Alex Vuong <alex.vuong@salesforce.com> Co-authored-by: Vincent Marta <vmarta@salesforce.com> * [V2] Implement dev server serveStaticFile (#580) * implement dev serveStaticFile * serve favicon in typescript template * add test * move mock closer to test case * [V2] Remove dadJoke in `template-typescript-minimal` (#585) * Replaced dadjoke with simple exp to demo getProps * Added a comment to explain mock function for getProps * Reduce getProps timeout to 50ms * remove unused manifest path (#582) * Silent output when cleaning config folder (#588) * [V2]Drop node 12 support for (#589) * drop node 12 in v2 * [V2] workaround shims issue windows (#584) * fix shims issue on Windows with a workaround * [V2] Clarify that service worker does not have to be hosted at the root (#590) * [V2] Add favicon for `template-retail-react-app` (#568) * Fix favicon path in ssr.js * Conditionally update favicon url to support dev & prod builds * Remove old serve favIcon flow and favIconPath option from config * Fix lint errors * Removed test for old serve favicon flow * remove references to faviconPath * Removed references to manifestPath * Bump v2 to v2.0.0-alpha.0 (#592) * Version 2.0.0-alpha.0 * Bump to 2.0.0-alpha.0 * Bump `pwa-kit-runtime` peerDependencies to 2.0.0-alpha.0 Co-authored-by: Adam Raya Navarro <arayanavarro@salesforce.com> * Merge branch `release-2.0.x` into `v2` and bump version (#595) * Release V2.0.0-alpha.0 (#593) * Bump V2 to `2.0.0-dev.8` (#575) * Bump version * Fix up readme for new package * Fixed loading correct amount of skeletons (#576) Port PR 525 into V2 * Make sure that generated project has pwa-kit-* packages pinned (#577) * Add comment explaining dev server import. (#578) * Add comment explaining dev server import. * lint:fix * [V2][Generator] Add `typescript-minimal` and `typescript-minimal-test-project` presets (#574) * Add `typescript-minimal` and `typescript-minimal-test-project` presets * lint * copy * Testing CI parallelism * Testing CI parameters * PR Feedback * ops forgot to update two references * Move pwa-kit-runtime to as a dependency instead of devDependency (#572) * move pwa-kit-runtime to as a dependency instead of devDependency in pwa-kit-dev * Wjh/translations docs (#570) * Update translation readme Co-authored-by: Alex Vuong <alex.vuong@salesforce.com> Co-authored-by: Vincent Marta <vmarta@salesforce.com> * [V2] Implement dev server serveStaticFile (#580) * implement dev serveStaticFile * serve favicon in typescript template * add test * move mock closer to test case * [V2] Remove dadJoke in `template-typescript-minimal` (#585) * Replaced dadjoke with simple exp to demo getProps * Added a comment to explain mock function for getProps * Reduce getProps timeout to 50ms * remove unused manifest path (#582) * Silent output when cleaning config folder (#588) * [V2]Drop node 12 support for (#589) * drop node 12 in v2 * [V2] workaround shims issue windows (#584) * fix shims issue on Windows with a workaround * [V2] Clarify that service worker does not have to be hosted at the root (#590) * [V2] Add favicon for `template-retail-react-app` (#568) * Fix favicon path in ssr.js * Conditionally update favicon url to support dev & prod builds * Remove old serve favIcon flow and favIconPath option from config * Fix lint errors * Removed test for old serve favicon flow * remove references to faviconPath * Removed references to manifestPath * Bump v2 to v2.0.0-alpha.0 (#592) * Version 2.0.0-alpha.0 * Bump to 2.0.0-alpha.0 * Bump `pwa-kit-runtime` peerDependencies to 2.0.0-alpha.0 Co-authored-by: Adam Raya Navarro <arayanavarro@salesforce.com> Co-authored-by: Ben Chypak <bchypak@mobify.com> Co-authored-by: vcua-mobify <47404250+vcua-mobify@users.noreply.github.com> Co-authored-by: Vincent Marta <vmarta@salesforce.com> Co-authored-by: Will Harney <62956339+wjhsf@users.noreply.github.com> Co-authored-by: Alex Vuong <52219283+alexvuong@users.noreply.github.com> Co-authored-by: Kevin He <kevin.he@salesforce.com> Co-authored-by: Jainam Sheth <99490559+shethj@users.noreply.github.com> * Bump version to `2.0.0-alpha.1` * Manually bump version on `pwa-kit-runtime` peerDependency Co-authored-by: Ben Chypak <bchypak@mobify.com> Co-authored-by: vcua-mobify <47404250+vcua-mobify@users.noreply.github.com> Co-authored-by: Vincent Marta <vmarta@salesforce.com> Co-authored-by: Will Harney <62956339+wjhsf@users.noreply.github.com> Co-authored-by: Alex Vuong <52219283+alexvuong@users.noreply.github.com> Co-authored-by: Kevin He <kevin.he@salesforce.com> Co-authored-by: Jainam Sheth <99490559+shethj@users.noreply.github.com> * comment out the session bridge call (#597) * [v2] Automatically bind all factory methods (#598) * automatically bind all factory methods * bind remote server methods * bind object functions in getRuntime * add test for getRuntime * fix lint * Update CHANGELOG files (#608) * Update CHANGELOG files * Add more changes Co-authored-by: Ben Chypak <bchypak@mobify.com> Co-authored-by: vcua-mobify <47404250+vcua-mobify@users.noreply.github.com> Co-authored-by: Vincent Marta <vmarta@salesforce.com> Co-authored-by: Will Harney <62956339+wjhsf@users.noreply.github.com> Co-authored-by: Alex Vuong <52219283+alexvuong@users.noreply.github.com> Co-authored-by: Kevin He <kevin.he@salesforce.com> Co-authored-by: Jainam Sheth <99490559+shethj@users.noreply.github.com> * adjust readme for v2 release (#612) * adjust readme for v2 release * Release final V2 version (#613) * Version 2.0.0 * Bump peerDependency * Begin development on 2.1.0 * Bump peerDependecy Co-authored-by: Ben Chypak <bchypak@mobify.com> Co-authored-by: vcua-mobify <47404250+vcua-mobify@users.noreply.github.com> Co-authored-by: Vincent Marta <vmarta@salesforce.com> Co-authored-by: Will Harney <62956339+wjhsf@users.noreply.github.com> Co-authored-by: Alex Vuong <52219283+alexvuong@users.noreply.github.com> Co-authored-by: Kevin He <kevin.he@salesforce.com> Co-authored-by: Jainam Sheth <99490559+shethj@users.noreply.github.com>
Description
We recently added
serveStaticFile
to the runtime api, however we noticed that it only works on a remote environment, it throws a 404 error on local development. This is because that the remote serverserveStaticFile
implementation relies on a/build
folder that may not exists on local file system.The tricky part about this is that static files are inside
/app/static
and the files gets copied over to/build/static
by webpack. We need to re-write the paths.The solution is to implement
serveStaticFile
in theDevServerMixin
. The implementation is based on the webpack dev middleware context and we can leverage the the source file path from the stats.Types of Changes
Changes
How to Test-Drive This PR
npm ci
/build
, remove the folder if you do)http://localhost:3000/favicon.ico
and verify the file is served correctlyChecklists
General
Accessibility Compliance
You must check off all items in one of the follow two lists:
or...
Localization